Controls = {
	handleInput:function(){
		if(Controls.keydown.up == true){Game.player.speedUp();}
		if(Controls.keydown.down == true){Game.player.speedDown();}
		if(Controls.keydown.right == true){Game.player.turnRight();}
		if(Controls.keydown.left == true){Game.player.turnLeft();}
		if(Controls.keydown.space == true){Game.player.shoot();}
	}
};

/*key detection*/
$(function() {
  Controls.keydown = {};
  function keyName(event) {
    return jQuery.hotkeys.specialKeys[event.which] ||
      String.fromCharCode(event.which).toLowerCase();
  }
  $(document).bind("keydown", function(event) {
    Controls.keydown[keyName(event)] = true;
  });
  $(document).bind("keyup", function(event) {
    Controls.keydown[keyName(event)] = false;
  });
});
